
namespace CCStatisticsTDD.TDDViewOutputStatus
{
    using CCStatistics.Domain.Api.Interfaces;

    using ThoughtWorks.CruiseControl.Core.Publishers.Statistics;
    using System;
    using System.Collections.Generic;

    public class MockTDDView : ICCStatsView
    {

        public void Clear()
        {

        }

        public void WriteDetailLine(string message)
        {
            Console.WriteLine(message);
        }

        public void WriteLine(string message)
        {
            Console.WriteLine(message);
        }

        public void InitialiseProgress(int totalLogFiles)
        {
            Console.WriteLine("Total Log Files = " + totalLogFiles);

        }

        public void IncrementProgress()
        {
            Console.WriteLine("++Increment Progress");

        }

        public void AlertBatch(IEnumerator<string> alertMessage)
        {
        }

        public void Alert(string message)
        {
            Console.WriteLine(" ALERT!!! " + message);

        }

        public void EndExecutionRun(string projectName, bool cancelAbort)
        {
        }

        /// <summary>
        /// Updates the view from active statistics.
        /// </summary>
        /// <param name="statistics">The statistics.</param>
        /// <param name="projectName">Name of the project.</param>
        /// Documentation Created 6/19/2008
        public void UpdateViewFromActiveStatistics(List<Statistic> statistics, string projectName)
        {
            var iIndex = 0;
            WriteLine(projectName);
            statistics.ForEach(x => WriteLine("node" + (iIndex++) + "  " + x.Name + " [" + x.Xpath + "]"));

        }



        public DateTime RenderProjectStart(string name, DateTime dtTime)
        {
            WriteLine("*** Started at: " + dtTime);
            return dtTime;
        }
    }
}
